import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/',
    name: 'homeIndex',
    component: () => import(/* webpackChunkName: "homeIndex" */ '../views/homeIndex/index.vue'),
    redirect: '/homeIndex/table',
    children: [
      {
        path: '/homeIndex/table',
        name: 'table',
        component: () => import(/* webpackChunkName: "table" */ '../views/homeIndex/pages/table.vue'),
      },
      {
        path: '/homeIndex/echarts',
        name: 'echarts',
        component: () => import(/* webpackChunkName: "table" */ '../views/homeIndex/pages/echarts.vue'),
      },
      {
        path: '/homeIndex/form',
        name: 'form',
        component: () => import(/* webpackChunkName: "table" */ '../views/homeIndex/pages/form.vue'),
      },
      {
        path: '/homeIndex/list',
        name: 'list',
        component: () => import(/* webpackChunkName: "table" */ '../views/homeIndex/pages/list.vue'),
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "about" */ '../views/login/index.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
